﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ReclutamientoCosea
{
    public delegate void CerrarDetalleDatos(object obj, bool resultado);
    
	/// <summary>
	/// Interaction logic for wDatosFamilares.xaml
	/// </summary>
	public partial class wDatosFamilares : Window
	{
        public event CerrarDetalleDatos CerrarVentana;        
        private object _datos;
        private int _queMuestra = 0;
        private int _renglon = 0;

        public int Renglon
        {
            get { return _renglon; }
            set { _renglon = value; }
        }
		public wDatosFamilares(int queMuestra, object Datos)
		{
            _queMuestra = queMuestra;
            _datos = Datos;
			this.InitializeComponent();
            this.Loaded += new RoutedEventHandler(wDatosFamilares_Loaded);
			// Insert code required on object creation below this point.
		}

        void wDatosFamilares_Loaded(object sender, RoutedEventArgs e)
        {

            switch (_queMuestra )
            {
                case 0:
                        dfDatos.CurrentItem = (DatosFamiliaresEntreCosea)_datos;
                        break;
                case 1:
                        dfDatos.CurrentItem = (HijosEntreCosea)_datos;
                        break;
                case 2:
                        dfDatos.CurrentItem = (HermanosEntreCosea)_datos;
                        break;
                case 3:
                        dfDatos.CurrentItem = (ExperienciaLaboralEntreCosea)_datos;
                        break;
                case 4:
                        dfDatos.CurrentItem = (ReferenciasEntreCosea)_datos;
                        break;
                case 5:
                        dfDatos.CurrentItem = (Empresa)_datos;
                        break;
                default:
                    break;
            }

        }

        private void btnAceptar_Click(object sender, RoutedEventArgs e)
        {
           
            this.CerrarVentana(dfDatos.CurrentItem, true);
            this.Close();

        }

        private void btnCancelar_Click(object sender, RoutedEventArgs e)
        {
            CerrarVentana(null,false);
            this.Close();
        }
	}
}